package com.rpj.stauy.controller;

import com.rpj.stauy.service.PersistenceChatAssistent;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class PersistenceChatController {

    @Resource
    private PersistenceChatAssistent persistenceChatAssistent;

    //http://localhost:9098/persistence/chat
    @GetMapping("persistence/chat")
    public String persistenceChat(){
        persistenceChatAssistent.chat(2L,"我叫redis");
        persistenceChatAssistent.chat(2L,"我叫什么");
        persistenceChatAssistent.chat(1L,"我叫java");
        return persistenceChatAssistent.chat(1L,"我叫什么");
    }
}
